from django.db import models


# Create your models here.
class User(models.Model):
    phone = models.CharField(max_length=11, unique=True, blank=False)
    password = models.CharField(max_length=50, blank=False)
    img = models.CharField(max_length=255, blank=True, null=True)
    username = models.CharField(max_length=150, unique=True, blank=False)

    def __str__(self):
        return self.username

    class Meta:
        db_table = 'user'


class Sflogin(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    types = models.CharField(max_length=10, blank=False)
    uid = models.CharField(max_length=50, blank=False)
    token = models.CharField(max_length=255, blank=True, null=True)

    def __str__(self):
        return self.types

    class Meta:
        db_table = 'sflogin'
